package com.github.itdachen.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description:
 * Created by 王大宸 on 2023-09-23 21:47
 * Created with IntelliJ IDEA.
 */
@Controller
public class DevDashboardController {


    @GetMapping({"/", "/dev/table/info/index"})
    public String index() {
        return "index";
    }


    @GetMapping(value = "/dev/table/info/db_list")
    public String db_list() {
        return "/db_list";
    }

    @GetMapping({"/dev/table/info/add"})
    public String add() {
        return "add";
    }

    @GetMapping({"/dev/table/info/column/{id}"})
    public String column(@PathVariable("id") String id, ModelMap modelMap) {
        modelMap.put("tableId", id);
        return "column";
    }

    @GetMapping(value = "/dev/table/info/edit/{id}")
    public String edit(@PathVariable("id") String id, ModelMap modelMap) {
        modelMap.put("id", id);
        return "/edit";
    }

    @GetMapping(value = "/dev/table/info/view/{id}")
    public String preview(@PathVariable("id") String id, ModelMap modelMap) {
        modelMap.put("id", id);
        return "/preview";
    }


}
